<?php
html::printPath(html::createCrudPath('person', $person, array('first_name', 'last_name'), 'id'));
$msg->printMessages();

$fb = new FormBuilder('person', $person);
$fb->text('first_name')->required();
$fb->text('last_name')->required();
$fb->text('other_names')->hint();
$fb->text('title');
$fb->text('yoga_name');
$fb->radioButtons('gender', array('M','F'), 'person.gender-')->required();
$fb->date('birth_date');

$fb->delimiter(text::get('person-idetificationPapers'));
$fb->comboBox('idcard_type', $idcardTypeOptions);
$fb->text('idcard_number');
$fb->comboBox('citizenship_code', $countryOptions)->hint();

$fb->delimiter(text::get('person-permanentAddress'));
$fb->text('street');
$fb->text('city');
$fb->text('postal_code');
$fb->comboBox('country_code', $countryOptions)->required();

$fb->delimiter();
$fb->comboBox('country_of_residence_code', $countryOptions);
$fb->comboBox('preferred_language', form::languageOptions())->noEmptyOption()->required();

$fb->spacer();
$fb->text('telephone');
$fb->text('email');
$fb->yesNoBox('is_ztp')->hint();
$fb->selectMany('person_tag_ids', $personTagOptions);

$fb->delimiter();
$fb->description(text::get('person-organization-info'));
$fb->comboBox('organization_id', $organizationOptions)->hint();

$fb->spacer();
$fb->textarea('notes')->hint();
$fb->submitButton();
$fb->write();
